<?php
// +----------------------------------------------------------------------
// | 幕小铺
// +----------------------------------------------------------------------
// | 版权所有 2016~2020 幕小铺科技（大连）有限公司
// +----------------------------------------------------------------------
// | 2020/03/14
// +----------------------------------------------------------------------

namespace app\video\datacache;

use think\facade\Cache;
use think\facade\Debug;
/**
 * 视频缓存层
 * @package app\user_center\model
 */
class VideoPlay{

    
    /**
     * 视频信息 缓存
     * @param uid int 用户id
     * @param limit 获取池子大小 默认500条
     * @param cache 是否更新 缓存 
     * @author jason wang <120907037@qq.com>
     * @return array
     */
   /*  public function getInfoByPlayid($play_id, $cache = false){
        $cacheName = 'getInfoByPlayid'.$play_id;//dump(!Cache::get($cacheName));
        if(!Cache::get($cacheName) || $cache){//dump($cache);
            $info = model('VideoPlay') -> getInfoByPlayid($play_id);
            Cache::set($cacheName, $info, 60*60*24*30);//默认缓存30天
            
        }
        return Cache::get($cacheName);
    } */

    /**
     * 视频标准 对象
     * @param uid int 用户id
     * @param limit 获取池子大小 默认500条
     * @param cache 是否更新 缓存 
     * @author jason wang <120907037@qq.com>
     * @return array
     */
    public function getInfoByPlayid($user_id = 0, $play_id){
        //视频表信息 缓存
        $info = model('video/VideoPlay') -> getPlayinfoByPlayid($play_id, $cache = true);//视频基本信息 缓存
        if($info['code'] != 200){
            return array_out(-1005, 'error');//逻辑错误
        }
        $infoObj = $info['data'];
        
        $result = [];
        //视频 阿里信息
        //$aliVideoInfo = datacache('VideoPlay') -> getAliVideoInfoByVideoid('3a160fbc3c274428bb974f914b41cadd');//用户统计缓存
        $aliVideoInfo = datacache('VideoPlay') -> getAliVideoInfoByVideoid($infoObj->video_id);//用户统计缓存
        if($aliVideoInfo['code'] <= 0){
            return array_out(-1005, '该视频暂时无法播放与访问');//逻辑错误
        }
        $coverURL = $aliVideoInfo['data']['coverURL'];
        $playUrl = $aliVideoInfo['data']['playUrl'];

        //对应的完整视频
        $father_play_id = $infoObj->father_play_id;//对应的长视频id
        $playId = $infoObj->id;
        $playType = $infoObj->play_type;
        $fatherPlayInfo = [];
        if($father_play_id > 0){//如果存在对应的完整视频 那么 视频信息调用完整视频信息
            //视频表信息 缓存
            $info = model('video/VideoPlay') -> getPlayinfoByPlayid($father_play_id, $cache = false);//视频基本信息 缓存
            if($info['code'] != 200){
                return array_out(-1005, 'error');//逻辑错误
            }
            $infoObj = $info['data'];
            $play_id = $father_play_id;
            
            //完整视频
            $fatherPlayInfoRel = $this -> getInfoByPlayid($user_id, $father_play_id);
            if($fatherPlayInfoRel['code'] == 200) $fatherPlayInfo = $fatherPlayInfoRel['data'];
        }

        $userinfo =controller('user_center/Userlogic', 'logic\user') -> get_user_info($user_id, $infoObj->uid);
        
        //查询播放量（缓存）
        $map = [];
        $map['play_id'] = $play_id;
        $map['seconds'] = ['>', 0];
        $video_plays = model('VideoPlayWatchcount') -> where($map) -> count();//播放次数

        //是否点赞
        $support = model('VideoPlaySupport') -> isSupport($user_id, $play_id);//是否点赞
        $isSupport = $support['code'] == 200 ? 1 : 0;

        //视频标签 缓存
        $lable_arr = datacache('VideoPlayLabelRelation') -> getPlayLable($infoObj->id);

        //是否存在完整版

        //关联商品
        $goods_list = [];
        $list = controller('VideoGoodslogic', 'logic') -> getGoodsListByPlayid($playId);
        if($list['code'] == 200) $goods_list = $list['data'];
        //dump($goods_list);
        if(isset($info['data'])){
            $result = [
                'playCommentTimes'      => (int)$infoObj -> comment_times,//评论数
                'playSupportTimes'      => (int)$infoObj -> support_times,//作品点赞数
                'playPlayerTimes'       => (int)$video_plays,//视频播放量
                'playShareTimes'        => (int)mt_rand(0,100),//作品分享数
                'playId'                => (int)$playId,
                'playVideoId'           => (string)$infoObj->video_id,
                'playTitle'             => (string)$infoObj->main_title,
                'playDecription'        => (string)$infoObj->description,
                'playDatetime'          => (int)$infoObj->create_time,
                'playType'              => (int)$playType,
                'isImmerse'             => (int)$infoObj->is_immerse,
                'isRotate'              => (int)$infoObj->is_rotate,
                'isOriginal'            => (int)$infoObj->is_original,
                'playUrl'               => (array)$playUrl,
                'fatherPlayInfo'        => (object)$fatherPlayInfo,
                'coverUrl'              => (string)$coverURL,
                'isSupport'             => (int) $isSupport,//是否点赞
                'videoClassid'          => (int)$infoObj->video_classid,
                //'videoClassName'        => (string)$infoObj->get_video_play_class->title,
                'videoLable'            => (array)$lable_arr,
                'state'                 => $infoObj->play_operation_status,
                'userInfo'              => $userinfo['data'],
                'goodsList'             => (array)$goods_list,
            ];
        }

        return array_out(200, 'success', $result);//逻辑错误
    }

    /**
     * 用户的 视频缓存池
     * @param uid int 用户id
     * @param limit 获取池子大小 默认500条
     * @param cache 是否更新 缓存 
     * @author jason wang <120907037@qq.com>
     * @return array
     */
    public function getListByUid($uid, $limit = 500, $cache = true){
        $cacheName = 'play_list_uid_'.$uid.'_'.$limit;//dump(!Cache::get($cacheName));
        if(!Cache::get($cacheName) || $cache){//dump($cache);
            $map = [];
            $map['uid']	= $uid;
            $map['play_operation_status']	= 1;
			$map['play_status'] 			= 1;//视频状态 0禁用 1启用 2测试可见
			$map['father_play_id'] 			= 0;//过滤精简版视频
            $list = model('video/VideoPlay') -> where($map) ->limit($limit) -> order('create_time desc') -> select() ->toArray();//用户视频池
            if(!empty($list)){
                Cache::set($cacheName, $list, 60*60);//默认缓存1小时
            }
        }
        return Cache::get($cacheName);
    }

    /**
     * 获取一条 关注推送视频(弃用)
     * @param uid int 用户id
     * @param f_uid 关注的人 用户id
     * @param cache 是否更新 缓存
     * @author jason wang <120907037@qq.com>
     * @return array
     */
    public function getOneFollowPushFilter($uid, $f_uid){
        $cacheName = 'play_list_followpush_uid_'.$uid.'_'.$f_uid;
        $list = $this -> getFollowPushFilter($uid, $f_uid);
        $result = [];
        if(!empty($list)){
            $result=array_shift($list);
            if(!empty($result)){
                //添加推送记录
                $uid        = $uid;
                $play_id    = $result['id'];
                model('video/VideoPlayFollowpush') -> addData($uid, $play_id);
                //剩余的数组塞回去
            
                Cache::set($cacheName, $list, 60*60);//1小时
            }
        }
        return $result;
    }

    /**
     * 用户 关注推送过滤后 剩余的 推送池
     * @param uid int 用户id
     * @param f_uid 关注的人 用户id
     * @param cache 是否更新 缓存
     * @author jason wang <120907037@qq.com>
     * @return array
     */
    public function getFollowPushFilter($uid, $f_uid, $cache = true){
        $cacheName = 'play_list_followpush_uid_'.$uid.'_'.$f_uid;
        if(!Cache::get($cacheName) || $cache){
            //初始化定义
            $list_play = $list_push = $list_push_playid_arr = $result_list = [];
            //查询用户缓存池
            $list_play = $this -> getListByUid($f_uid);
            $list_play = is_array($list_play) ? $list_play : [];
            //查询推送记录
            $map = [];
            $map['uid'] = $uid;
            $list_push = model('video/VideoPlayIndexpush') -> where($map) -> order('create_time desc') -> column('play_id');

            //play_id集合数组
            $list_push_playid_arr = !empty($list_push) ? $list_push : [];
            //删选出 剩余的list
            $result_list = [];//dump($list_play);die;
            foreach ($list_play as $key => $value) {
                if(in_array($value['id'], $list_push_playid_arr)) continue;
                $result_list[] = $value;
            }
            Cache::set($cacheName, $result_list, 60*60);//1小时
        }
        $list = Cache::get($cacheName);
        return $list;
    }


    /**
     * 获取用户 首页推送 池子缓存
     * @param uid int 用户id
     * @param play_type int 视频类型 1短视频 2长视频
     * @param cache 是否更新 缓存
     * @author jason wang <120907037@qq.com>
     * @return array
     */
    public function getIndexPushListByUid($uid, $play_type, $class_id, $cache = false){
        $cacheName = 'index_push_play_list_uid_'.$uid.'_'.$play_type.'_'.$class_id;
        $cache_list = Cache::get($cacheName);//print_r(empty($cache_list));
        if(empty($cache_list) || $cache){
            $list = model('VideoPlay') -> getIndexPushOther1000($uid, $play_type, $class_id);
            if(!empty($list['data'])){//存在未推送过的 存储缓存
                Cache::set($cacheName, $list['data'], 60*60*24);//默认缓存1天
            }else{
                //查询分类下所有子分类
                $map = $class_id_arr =[];
                $map['pid'] = $class_id;
                $list_class = model('VideoPlayClass') -> where($map) -> select()->toArray();
                foreach ($list_class as $key => $value) {
                    $class_id_arr[] = $value['id'];
                }
                
                //拉取最新1000条
                $map = [];
                //$map['play_operation_status'] = 1;
                //$map['play_type'] = $play_type;
                $map[] = ['play_status', '=', 1];
                $map[] = ['play_operation_status', '=', 1];
                $map[] = ['play_type', '=', $play_type];
                if($class_id > 0) $map[] = ['video_classid', 'in', $class_id_arr];
                //$map['video_classid'] = ['in', $class_id_arr];
                $list = model('VideoPlay') ->where($map) -> order('create_time desc') -> limit(1000) -> select()->toArray();
                
                Cache::set($cacheName, $list, 60*60*24);//默认缓存1天
            }
        }
        return Cache::get($cacheName);
    }

    /**
     * 首页推荐 推送
     * @param uid int 用户id
     * @param cache 是否更新 缓存
     * @author jason wang <120907037@qq.com>
     * @return array
     */
    public function getIndexOnePushListByUid($uid, $play_type = 1, $num = 10, $class_id = 0){
        $cacheName = 'index_push_play_list_uid_'.$uid.'_'.$play_type.'_'.$class_id;
        //最新的1000条数据
        $list  = $this -> getIndexPushListByUid($uid, $play_type, $class_id);
        
        $i = 0;
        $lista = [];
        //标准统一返回
        foreach ($list as $key => $value) {
            //添加推送记录
            $uid        = $uid;
            $play_id    = $value['id'];
            model('video/VideoPlayIndexpush') -> addData($uid, $play_id, $play_type);

            $lista[] = $value;
            //推送数据 缓存池剔除
            unset($list[$key]);
            $i++;
            if($i == $num) break;
        }

        $result_list = controller('Videologic', 'logic')->returnBaceArray($uid, $lista);

        
        //缓存池子 重新赋值
        Cache::set($cacheName, $list, 60*60*24);//默认缓存1天

        return array_out(200, 'success', $result_list);
    }

    /**
     * 首页推荐 推送(游客随机推送)
     * @param uid int 用户id
     * @param cache 是否更新 缓存
     * @author jason wang <120907037@qq.com>
     * @return array
     */
    public function getIndexOnePushList($num, $class_id = 0, $play_type){
        //查询分类下所有子分类
        $map = $class_id_arr =[];
        $map['pid'] = $class_id;
        $list_class = model('VideoPlayClass') -> where($map) -> select()->toArray();
        foreach ($list_class as $key => $value) {
            $class_id_arr[] = $value['id'];
        }
        $class_id_str = implode(',', $class_id_arr);

        //拉取最新1000条
        $map = [];
        $map[] = ['play_operation_status', '=', 1];
		$map[] = ['play_status', '=', 1];//视频状态 0禁用 1启用 2测试可见
        $map[] = ['play_type', '=', $play_type];
        if($class_id > 0) $map[] = ['video_classid', 'in', $class_id_str];
        $list = model('VideoPlay')->where($map) -> order('create_time desc')->cache(true, 60*60*24)  -> limit(10000) -> select();
        if(!$list) return array_out(200, 'success', []);
        $list = $list -> toArray();
        
        $num = count($list) <= $num ? count($list) : $num;
        if($num > 1){
            $rel_list = array_rand($list,$num);
            $i = 0;
            foreach ($rel_list as $key => $value) {
                $value_list[] = $list[$value];
                $i++;
                if($i == $num) break;
            }
        }else{
            $value_list = $list;
        }
        
        //标准输出
        $result_list = controller('Videologic', 'logic')->returnBaceArray($uid=0, $value_list);
        //dump($result_list);
        return array_out(200, 'success', $result_list);
    }

    /**
     * 首页推荐轮播
     * @param int num 数量
     * @author jason wang <120907037@qq.com>
     * @return array
     */
    public function getIndexRecommendPushListByUid($num = 10){
        $map = [];
        $map['is_recommend'] = 1;
        $map['play_operation_status'] = 1;
        $list = model('VideoPlay') -> where($map)  -> limit($num) -> select();
        $result_list = [];
        //标准输出
        $result_list = controller('Videologic', 'logic')->returnBaceArray($uid=0, $list);
        return array_out(200, 'success', $result_list);
    }
	
	/**
	 * 根据分类查询视频
	 * @param int class_id 分类id
     * @author shiqiang
     * @return array
	 */
	public function getClassPlayPushList($class_id, $play_type = 0){
		$map = [];
        if($play_type) $map['play_type'] 	= $play_type;
        $map['video_classid'] 	= $class_id;
		$map['play_operation_status'] 	= 1;
		$map['play_status'] 			= 1;//视频状态 0禁用 1启用 2测试可见
		$info = model('VideoPlay') ->field('id') -> where($map) -> cache(60*60*24) -> find();
        return array_out(200, 'success', $info);
    }
    
    /**
     * 根据play_id  查询阿里信息缓存
     * @param int num 数量
     * @author jason wang <120907037@qq.com>
     * @return array
     */
    public function getAliVideoInfoByVideoid($video_id, $cache = false){
        $cache_name = 'aliyun_playbace_'.$video_id;
        $timeout = 3600*24*30;//30天
        
        if(!Cache::get($cache_name) || $cache){
            $videobase = controller('video/Vodlogic', 'logic')->getPlayInfo($video_id, $timeout);//获取视频播放信息
            if($videobase['code'] == 200 && $videobase['data']['VideoBase']['Status'] != 'Uploading'){
                Cache::set($cache_name, $videobase);
            }else{
                return array_out(-1001, 'error', $videobase['message']);
            }
        }
        $videobase = Cache::get($cache_name);
        $playUrl = [];
        $height =0;
        $width =0;
        foreach ($videobase['data']['PlayInfoList']['PlayInfo'] as $key1 => $value1) {
            if($value1['Height'] == 0) continue;
            $playUrl[] = [
                'definition' => $value1['Definition'],
                'playURL'    => $value1['PlayURL'],
                'width'      => $value1['Width'],
                'height'     => $value1['Height'],
                'duration'   => $value1['Duration'],
            ];
            //宽高比例
            $width = 500;
            
            $height = intval($width/($value1['Width']/$value1['Height']));
        }
        $CoverURL = isset($videobase['data']['VideoBase']['CoverURL']) ? $videobase['data']['VideoBase']['CoverURL'] : '';

        //$list['coverURL'] = $CoverURL.'?x-oss-process=image/resize,m_pad,h_'.$height.',w_'.$width.',color_cccccc';//缩略图等比缩放
        $list['coverURL'] = str_replace("00002","00001", $CoverURL);//缩略图等比缩放
        $list['playUrl']  = $playUrl;

        //如果 资源数量 小于等于 1 表示没转码
        if(count($playUrl)<=1 || $CoverURL == '' || $videobase['data']['VideoBase']['Status'] == 'Uploading'){
            Cache::rm($cache_name);
            //dump($video_id);
        }
        return array_out(200, 'success', $list);
    }

    /**
     * 评论我的 数据列表R
     * @param int num 数量
     * @author jason wang <120907037@qq.com>
     * @return array
     */
    public function myCommentReplyList($user_id, $cache = false){
        $cache_name = 'myCommentReplyList_'.$user_id;
        if(!Cache::get($cache_name) || $cache){
            //评论我的数据
            $map = [];
            $map['play_authorid'] = $user_id;
            $map['comment_status'] = 0;
            $comment_list = model('VideoPlayComment') -> where($map) -> select();
            //if($comment_list) $comment_list = $comment_list->toArray();
            $list_one =[];
            foreach ($comment_list as $key => $value) {

                $playInfo = datacache('VideoPlay') -> getInfoByPlayid($user_id, $value['play_id']);
                if($playInfo['code'] != 200){
                    continue;
                }

                //用户信息
                //$userinfo =controller('user_center/Userlogic', 'logic\user') -> get_user_info($user_id, $value -> uid);

                //评论标准 对象
                $commentInfo = datacache('VideoPlayComment', 'datacache') -> getDataByCommentid($user_id, $value['id']);

                $list_one[] = [
                    'playInfo'              => (object) $playInfo['data'],
                    'commentInfo'           => (object)$commentInfo['data'],
                    'replyArr'              => [],
                    'orderTime'             => (int)$value['create_time'],
                    
                ];
                
            }
            
            //回复过我的数据
            $map = [];
            $map['r_uid'] = $user_id;
            $replay_list = model('VideoPlayCommentReplay') -> where($map) -> select();
            $list_two = [];
            foreach ($replay_list as $key => $value) {
                
                $playInfo = datacache('VideoPlay') -> getInfoByPlayid($user_id, $value['play_id']);
                if($playInfo['code'] != 200){
                    continue;
                }

                //用户信息
                //$userinfo =controller('user_center/Userlogic', 'logic\user') -> get_user_info($user_id, $value -> get_video_play_comment -> get_uc_member -> uid);

                //评论标准 对象
                $commentInfo = datacache('VideoPlayComment', 'datacache') -> getDataByCommentid($user_id, $value['comment_id']);

                //回复标准对象
                $info = datacache('VideoPlayCommentReplay', 'datacache') -> getDataByReplyid($user_id, $value['id']);
                if($info['code'] != 200) continue;

                $list_two[] = [
                    //'authorUserInfo'        => (object) $userinfo['data'],
                    'playInfo'              => (object) $playInfo['data'],
                    'commentInfo'           => (object)$commentInfo['data'],
                    'replyArr'              => [
                        $info['data'],
                    ],
                    'orderTime'             => (int)$value['create_time'],
                    
                ];
            }
            //if($replay_list) $replay_list = $replay_list->toArray();

            $list = array_merge($list_one, $list_two);

            $create_time = array_column($list, 'orderTime');
            array_multisort($create_time, SORT_DESC, $list);

            Cache::set($cache_name, (array)$list);
        }

        return array_out(200, 'success', Cache::get($cache_name));
        
    }

    /**
     * 智能AI推送 新
     * @param uid int 用户id
     * @param cache 是否更新 缓存
     * @author jason wang <120907037@qq.com>
     * @return array
     */
    public function getPushListXin($uid, $play_type = 1, $class_id = 0, $num = 15){
        //获取用户  推送缓存池
        $list = $this ->  getPushListXin_cacheList($uid, $play_type, $class_id);
        if(empty($list)){
            $list = $this -> getPushListXin_cacheList($uid, $play_type, $class_id, $page =1, $cache = true);
            if(empty($list)){//全部推送过

            }
        }//dump($list);dump($num);
        //dump($list);
        $i = 0;
        $uid_arr=$lista = [];
        foreach ($list as $key => $value) {
            if(in_array($value['uid'], $uid_arr) && $play_type != 3) continue;//每个人只推送一条
            $lista[] = $value;//dump($value['uid']);
            $uid_arr[] = $value['uid'];//dump($uid_arr);//dump($value['uid']);
            //推送数据 缓存池剔除
            unset($list[$key]);
            $i++;
            if($i == $num) break;
        }
        //如果数据小于10条那么重新拉取缓存
        //if(count($lista) < $num) $list = $this -> getPushListXin_cacheList($uid, $play_type, $class_id, $page =1, $cache = true);
         
        $result_list = controller('Videologic', 'logic')->returnBaceArray($uid, $lista);
        
        
        //缓存池子 重新赋值
        $cacheName = 'getPushListXin_cacheList_'.$uid.'_'.$play_type.'_'.$class_id;
        Cache::set($cacheName, $list, 60*60);//默认缓存1天

        return array_out(200, 'success', $result_list);
        
    }

    /**
     * 智能AI推送 (获取未推送的缓存池1000条)
     * @param uid int 用户id
     * @param cache 是否更新 缓存
     * @author jason wang <120907037@qq.com>
     * @return array
     */
    public function getPushListXin_cacheList($uid, $play_type, $class_id, $page =1, $cache = false){
        $cache_name = 'getPushListXin_cacheList_'.$uid.'_'.$play_type.'_'.$class_id;
        if(!Cache::get($cache_name) || $cache){
            $pagesize = 1000;
            $start=($page-1)*$pagesize;//偏移量，当前页-1乘以每页显示条数
            $end = $page*$pagesize;
            $list = model('VideoPlay') -> getIndexPushOther1000($uid, $play_type, $class_id, $start, $end);
            if(!empty($list['data'])){//表示存在未观看数据
                Cache::set($cache_name, (array)$list['data'], 60*60);
            }else{//貌似全部都看完了
                /* $page++;dump($page);
                if($page >= 10) return [];//最多允许翻10页
                $list = $this -> getPushListXin_cacheList($uid, $play_type, $class_id, $page);
                if(!empty($list)){//表示存在未观看数据
                    Cache::set($cache_name, (array)$list);
                }else{
                    return [];
                } */
                return [];
            }
        }

        return Cache::get($cache_name);

        
    }
	
	/**
	 * 搜素 视频集合
	 * @param uid int 用户id
	 * @param video_title string 视频标题 / 标签名称
	 * @param video_type int 视频类型
     * @param cache 是否更新 缓存
     * @author shiqiang
     * @return array
	 */
	public function getPushSearchList($uid, $video_title, $video_type, $cache = true){
		$cache_name = 'getPushSearch_play_list'.$video_title.'play_type'.$video_type;
		if(!Cache::get($cache_name) || $cache){
			$play_list = datacache('video/VideoPlay') -> getPlayListSearchPush($uid, $video_title, $video_type);//视频集合
			$label_list = datacache('video/VideoPlay') -> getPlayLabelSearchPush($uid, $video_title, $video_type);//标签视频集合
			$list = array_merge($play_list, $label_list);
			$list = array_unique($list, SORT_REGULAR);//去重
			
			if(!empty($list)){
				Cache::set($cache_name, (array)$list, 60*60*24);
			}
		}
		
		$result_list = Cache::get($cache_name) ? Cache::get($cache_name) : [];
		return array_out(200, 'success', $result_list);
	}
	
	/**
	 * 搜素 视频主标题关键字
	 */
	public function getPlayListSearchPush($uid, $video_title, $video_type){
		/*****标题搜索集合******/
		$map = [];
		$map[] = ['main_title','like', '%'.$video_title.'%'];
		if(in_array($video_type, [1,2,3])) $map[] = ['play_type', '=', $video_type];
		$map[] = ['father_play_id', '=', 0];
		$map[] = ['play_operation_status', '=', 1];
		$play_list = model('VideoPlay') -> where($map) -> order('support_times desc,comment_times desc,create_time desc') -> select() -> toArray(); // 视频集合
		
		return $play_list;
	}
	
	/**
	 * 搜素 标签
	 */
	public function getPlayLabelSearchPush($uid, $video_title, $video_type){
		/*****标签搜索******/
		$map = [];
		$map['title'] = ['title', '=', $video_title];
		$label_id 	= model('VideoPlayClassLabel') -> where($map) -> column('id');
		$play_id 	= model('VideoPlayLabelRelation') -> where('label_id', 'in', $label_id) -> column('play_id');//关联的视频
		$label_play_list = [];//标签视频
		if(!empty($play_id)){
			foreach($play_id as $value){
				$map = [];
				$map[] = ['id', '=', $value];
				if(in_array($video_type, [1,2,3])) $map[] = ['play_type', '=', $video_type];
				$map[] = ['father_play_id', '=', 0];
				$map[] = ['play_operation_status', '=', 1];
				$play_info = model('VideoPlay') -> where($map) -> find();
				if(!empty($play_info)){
					$label_play_list[] =  $play_info -> toArray();
				}
			}
		}
		return $label_play_list;
	}
}
